import { TypeOrderList } from "../api/common/type";
import BaseRouter from "./baseRouter"
import beforRouter from "./interceptor"
import { TypeMerchantWxLogin } from "@/path/api/user/type";
/**注册路由 */
const Router = new BaseRouter(beforRouter)
/**导出路由 */
export default Router
//--tabbar
/**跳转到 tabbar/index */
export function toTabbarIndex() {
  return Router.switch({ url: "/pages/tabbar/index/index" })
}
/**跳转到 tabbar/mine */
export function toTabbarMine() {
  return Router.switch({ url: "/pages/tabbar/mine/index" })
}

/**跳转到 核销 页面 */
export function toVerification(params?: any) {
  return Router.navigate<null>({ url: "/pages/bussiness/verification/index" }, { data: params })
}

/**跳转到 核销二维码 页面 */
export function toVerificationTicket(params?: any) {
  return Router.navigate<null>({ url: "/pages/bussiness/verificationTicket/index" }, { data: params })
}

/**跳转到 购票详情 页面 */
export function toOrderDetail(params: { peopleNum: number, day: Date } | TypeOrderList.Item) {
  return Router.navigate<{ peopleNum: number, day: Date }>({ url: "/pages/bussiness/orderDetail/index" }, { data: params })
}
/**核销列表 */
export function toOrderRecord(p: { no: string }) {
  return Router.navigate<any>({ url: "/pages/bussiness/orderRecord/index" }, { data: p })
}
/**核销列表 */
export function toOrderRecordUser(p: { no: string }) {
  return Router.navigate<any>({ url: "/pages/bussiness/orderRecordUser/index" }, { data: p })
}

//--user-用户页面
/**跳转到 user/login 用户登录 页面 */
export function toUserLogin(params?: any) {
  return Router.navigate<TypeMerchantWxLogin.returnedVal>({ url: "/pages/user/login/index" }, { data: params })
}

/* 工具页面h5 */
export function toh5(params) {
  return Router.navigate<null>({ url: "/pages/tool/webViewPage/index" }, { data: { url: params } })
}

/* 工具富文本 */
export function toRichText(params: { text: string, title?: string }) {
  return Router.navigate<null>({ url: "/pages/tool/richTextPage/index" }, { data: params })
}

/**工具 页面状态状态 */
export function toStatusPage(params: { title: string, text: string, img: string, url?: string }) {
  return Router.navigate<null>({ url: "/pages/tool/statusPage/index" }, { data: params })
}